/*
 * $Author: cbeams $
 * $Date: 2007-06-04 19:47:27 +0000 (Mon, 04 Jun 2007) $
 * $Rev: 26 $
 */
/**
 *
 */
package com.db4o.eclipse.plugin.model;

import com.db4o.reflect.ReflectField;


public class Db4oStoredObjectInstanceField extends TreeParent {

    private ReflectField field;
    private boolean hasChildren = false;
    private Object object;
    private boolean populated;

    public Db4oStoredObjectInstanceField(Object object, ReflectField field) {
        super(field.getName() + ": " + object);
        this.field = field;
        this.object = object;
        if (field.getFieldType().getDeclaredFields().length > 0) {
            hasChildren = true;
        }
    }

    public void setPopulated(boolean populated) {
        this.populated = populated;
    }

    public boolean isPopulated() {
        return populated;
    }

    public Object getObject() {
        return object;
    }

    @Override
    public boolean hasChildren() {
        return hasChildren;
    }

    public ReflectField getReflectField() {
        return field;
    }

}
